CC = env python
FLAGS = -t
SRCS= *.py
OUTFILE=__init__.py

.PHONY:	all doctest clean

init:	$(SRCS)
	-rm $(OUTFILE)
	$(CC) $(FLAGS) -uc "import os; print '__all__ = [', [reduce(lambda x,y: (y[-2:]=='py' and x+y[:-3]+'\", \"') or x, filter( (lambda x: x.find('$(OUTFILE)')==-1), os.listdir('.') ), '\"')][0][:-3], ']'" | cat | tee $(OUTFILE)


doctest:	$(SRCS)
	$(CC) $(FLAGS) $(SRCS)

clean:
	-rm $(OUTFILE)
	-rm *.pyc
